package com.caifu.controller;

import com.caifu.bean.Result;
import com.caifu.bean.ResultUtil;
import com.caifu.service.ElderlyInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * ClassName : TimerController
 *
 * @author :  yb
 * @description ：
 * @date : 2020-12-04 14:04
 */
@Controller
@RequestMapping("/timerTest")
public class TimerController {

    @Resource
    private ElderlyInfoService elderlyInfoService;



    /**
     * 计算是否生效 通过生效时间   ---床位记录
     */
    @GetMapping(value = "updateBedRecordByEffectDate")
    @ResponseBody

    public Result<Object> updateBedRecordByEffectDate(String userNo) {
        try {
            elderlyInfoService.updateBedRecordByEffectDate(userNo);
            return ResultUtil.success();
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.error();
        }
    }


}
